var eeisus = 0, 
	eetrue = "VERDADERO", 
	eefalse = "FALSO", 
	eedec = ",", 
	eeth = ".", 
	eedecreg = new RegExp(",", "g"), 
	eethreg = new RegExp("\\.", "g"), 
	eecurrencyreg = new RegExp("[$]", "g"), 
	eepercentreg = new RegExp("%", "g"), 
	fmtdaynamesshort = ["dom", "lun", "mar", "mié", "jue", "vie", "sáb" ], 
	fmtdaynameslong = ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes","sábado" ], 
	fmtmonthnamesshort = [ "ene", "feb", "mar", "abr", "may","jun", "jul", "ago", "sep", "oct", "nov", "dic" ], 
	fmtmonthnameslong = ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio","agosto", "septiembre", "octubre", "noviembre", "diciembre" ], 
	fmtstrings = [",", " ", "/" ], 
	fmtdate6 = [ 7, 34, 3, 34, 11 ], 
	jsonLocal = '{"eeisus":0,"eetrue":"VERDADERO","eefalse":"FALSO","eedec":",","eeth":".","eedecreg":[",","g"],"eethreg":["\\\\.","g"],"eecurrencyreg":["[$]","g"],"eepercentreg":["%","g"],"fmtdaynamesshort":["dom","lun","mar","mié","jue","vie","sáb"],"fmtdaynameslong":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"fmtmonthnamesshort":["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],"fmtmonthnameslong":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],"fmtstrings":[","," ","/"]}'

function myIsNaN(x) {
	return isNaN(x) || typeof x == "number" && !isFinite(x)
}
function mod(n, d) {
	return n - d * Math.floor(n / d)
}
function round(n, nd) {
	if (isFinite(n) && isFinite(nd)) {
		var sign_n = n < 0 ? -1 : 1, abs_n = Math.abs(n), factor = Math.pow(10,
				nd);
		return sign_n * Math.round(abs_n * factor) / factor
	} else
		return NaN
}
function sum2(arr, rt, rb) {
	for ( var sum = 0, ii = rt; ii <= rb; ii++)
		sum += arr[ii];
	return sum
}
function sum3(arr, rt, ct, rb, cb) {
	for ( var sum = 0, ii = rt; ii <= rb; ii++)
		for ( var jj = ct; jj <= cb; jj++)
			sum += arr[ii][jj];
	return sum
}
function sumgeneral(cnt, vsum, vcnt, x) {
	for ( var sum = vsum, ii = 0; ii < x.length; ii++)
		sum += sum3(x[ii][0], x[ii][1], x[ii][2], x[ii][3], x[ii][4]);
	return sum
}
function b2s(b) {
	return b ? eetrue : eefalse
}
var near0RegExp = new RegExp("[.](.*0000000|.*9999999)");
function eedisplayFloat(x) {
	if (myIsNaN(x))
		return Number.NaN;
	else {
		var str = String(x);
		if (near0RegExp.test(str)) {
			x = round(x, 8);
			str = String(x)
		}
		return str.replace(/\./g, eedec)
	}
}
function eedisplayScientific(x, nd) {
	if (myIsNaN(x))
		return Number.NaN;
	else {
		var str = String(x.toExponential(nd));
		return str.replace(/\./g, eedec)
	}
}
function eedisplayFloatND(x, nd) {
	if (myIsNaN(x))
		return Number.NaN;
	else {
		var res = round(x, nd);
		if (nd > 0) {
			var str = String(res);
			if (str.indexOf("e") != -1)
				return str;
			if (str.indexOf("E") != -1)
				return str;
			var parts = str.split(".");
			if (parts.length < 2) {
				var decimals = "00000000000000".substring(0, nd);
				return parts[0].toString() + eedec + decimals
			} else {
				var decimals = (parts[1].toString() + "00000000000000")
						.substring(0, nd);
				return parts[0].toString() + eedec + decimals
			}
		} else
			return res
	}
}
function eedisplayPercent(x) {
	if (myIsNaN(x))
		return Number.NaN;
	else
		return eedisplayFloat(x * 100) + "%"
}
function eedisplayPercentND(x, nd) {
	if (myIsNaN(x))
		return Number.NaN;
	else
		return eedisplayFloatND(x * 100, nd) + "%"
}
function eeparseFloatTh(str) {
	str = String(str).replace(eethreg, "");
	str = String(str).replace(eedecreg, ".");
	var res = parseFloat(str);
	if (isNaN(res))
		return 0;
	else
		return res
}
function eedisplayFloatNDTh(x, nd) {
	if (myIsNaN(x))
		return Number.NaN;
	else {
		var res = round(x, nd);
		if (nd > 0) {
			var str = String(res);
			if (str.indexOf("e") != -1)
				return str;
			if (str.indexOf("E") != -1)
				return str;
			var parts = str.split("."), res2 = eeinsertThousand(parts[0]
					.toString());
			if (parts.length < 2) {
				var decimals = "00000000000000".substring(0, nd);
				return res2 + eedec + decimals
			} else {
				var decimals = (parts[1].toString() + "00000000000000")
						.substring(0, nd);
				return res2 + eedec + decimals
			}
		} else
			return eeinsertThousand(res.toString())
	}
}
function eedisplayPercentNDTh(x, nd) {
	if (myIsNaN(x))
		return Number.NaN;
	else
		return eedisplayFloatNDTh(x * 100, nd) + "%"
}
function eedisplayFloatNDThV(x, nd) {
	if (x == "")
		return x;
	if (isFinite(x))
		return eedisplayFloatNDTh(x, nd);
	else
		return x
}
var eeparseFloatThVreg = new RegExp("^ *-?[0-9.]+ *$");
function eeparseFloatThV(str) {
	if (str == "")
		return str;
	str = String(str).replace(eethreg, "");
	str = String(str).replace(eedecreg, ".");
	if (!eeparseFloatThVreg.test(str))
		return str;
	var res = parseFloat(str);
	if (isNaN(res))
		return str;
	else
		return res
}
function eeinsertThousand(whole) {
	if (whole == "" || whole.indexOf("e") >= 0)
		return whole;
	else {
		var minus_sign = "";
		if (whole.charAt(0) == "-") {
			minus_sign = "-";
			whole = whole.substring(1)
		}
		for ( var res = "", str_length = whole.length - 1, ii = 0; ii <= str_length; ii++) {
			if (ii > 0 && ii % 3 == 0)
				res = eeth + res;
			res = whole.charAt(str_length - ii) + res
		}
		return minus_sign + res
	}
}
function eedatefmt(fmt, x) {
	if (!isFinite(x))
		return Number.NaN;
	for ( var padding = 0, tmp = 0, res = "", len = fmt.length, ii = 0; ii < len; ii++)
		if (fmt[ii] > 31)
			res += fmtstrings[fmt[ii] - 32];
		else
			switch (fmt[ii]) {
			case 2:
				res += eemonth(x);
				break;
			case 3:
				tmp = eemonth(x);
				if (tmp < 10)
					res += "0";
				res += tmp;
				break;
			case 4:
				res += fmtmonthnamesshort[eemonth(x) - 1];
				break;
			case 5:
				res += fmtmonthnameslong[eemonth(x) - 1];
				break;
			case 6:
				res += eeday(x);
				break;
			case 7:
				tmp = eeday(x);
				if (tmp < 10)
					res += "0";
				res += tmp;
				break;
			case 8:
				res += fmtdaynamesshort[weekday(x, 1) - 1];
				break;
			case 9:
				res += fmtdaynameslong[weekday(x, 1) - 1];
				break;
			case 10:
				tmp = year(x) % 100;
				if (tmp < 10)
					res += "0";
				res += tmp;
				break;
			case 11:
				res += year(x);
				break;
			case 12:
				res += hour(x);
				break;
			case 13:
				tmp = hour(x);
				if (tmp < 10)
					res += "0";
				res += tmp;
				break;
			case 14:
				tmp = hour(x) % 12;
				if (tmp == 0)
					res += "12";
				else
					res += tmp % 12;
				break;
			case 15:
				tmp = hour(x) % 12;
				if (tmp == 0)
					res += "12";
				else {
					if (tmp < 10)
						res += "0";
					res += tmp
				}
				break;
			case 16:
				res += minute(x);
				break;
			case 17:
				tmp = minute(x);
				if (tmp < 10)
					res += "0";
				res += tmp;
				break;
			case 18:
				res += second(x);
				break;
			case 19:
				tmp = second(x);
				if (tmp < 10)
					res += "0";
				res += tmp;
				break;
			case 21:
			case 22:
				if (hour(x) < 12)
					res += "AM";
				else
					res += "PM";
				break;
			case 23:
				res += eedisplayFloat(x);
				break;
			case 24:
				tmp = fmt[++ii];
				res += eedisplayFloatND(x, tmp);
				break;
			case 25:
				tmp = fmt[++ii];
				res += eedisplayFloatNDTh(x, tmp);
				break;
			case 26:
				res += eedisplayPercent(x);
				break;
			case 27:
				tmp = fmt[++ii];
				res += eedisplayPercentND(x, tmp);
				break;
			case 28:
				tmp = fmt[++ii];
				res += eedisplayPercentNDTh(x, tmp);
				break;
			case 29:
				tmp = fmt[++ii];
				res += eedisplayScientific(x, tmp);
				break;
			case 30:
				padding = fmt[++ii];
				tmp = hour(x) + Math.floor(x) * 24;
				tmp = tmp.toString();
				if (tmp.length < padding)
					res += "00000000000000".substring(0, padding - tmp.length);
				res += tmp
			}
	return res
}
function leap_gregorian(year) {
	return year % 4 == 0 && !(year % 100 == 0 && year % 400 != 0)
}
var GREGORIAN_EPOCH = 1721425;
function gregorian_to_jd(year, month, day) {
	return GREGORIAN_EPOCH
			- 0
			+ 365
			* (year - 1)
			+ Math.floor((year - 1) / 4)
			+ -Math.floor((year - 1) / 100)
			+ Math.floor((year - 1) / 400)
			+ Math.floor((367 * month - 362) / 12
					+ (month <= 2 ? 0 : leap_gregorian(year) ? -1 : -2) + day)
}
function jd_to_gregorian(jd) {
	var wjd, depoch, quadricent, dqc, cent, dcent, quad, dquad, yindex, year, yearday, leapadj;
	wjd = Math.floor(jd);
	depoch = wjd - GREGORIAN_EPOCH - 1;
	quadricent = Math.floor(depoch / 146097);
	dqc = mod(depoch, 146097);
	cent = Math.floor(dqc / 36524);
	dcent = mod(dqc, 36524);
	quad = Math.floor(dcent / 1461);
	dquad = mod(dcent, 1461);
	yindex = Math.floor(dquad / 365);
	year = quadricent * 400 + cent * 100 + quad * 4 + yindex;
	if (!(cent == 4 || yindex == 4))
		year++;
	yearday = wjd - gregorian_to_jd(year, 1, 1);
	leapadj = wjd < gregorian_to_jd(year, 3, 1) ? 0 : leap_gregorian(year) ? 1
			: 2;
	var month = Math.floor(((yearday + leapadj) * 12 + 373) / 367), day = wjd
			- gregorian_to_jd(year, month, 1) + 1;
	return [ year, month, day ]
}
function eeday(serial_number) {
	if (!isFinite(serial_number))
		return Number.NaN;
	if (serial_number < 1)
		return 0;
	if (serial_number > 60)
		serial_number--;
	var res = jd_to_gregorian(serial_number + 2415020);
	return res[2]
}
function hour(serial_number) {
	if (!isFinite(serial_number))
		return Number.NaN;
	var res = Math
			.floor((serial_number - Math.floor(serial_number)) * 86400 + .5);
	return Math.floor(res / 3600)
}
function minute(serial_number) {
	if (!isFinite(serial_number))
		return Number.NaN;
	var res = Math
			.floor((serial_number - Math.floor(serial_number)) * 86400 + .5);
	return Math.floor(res / 60) % 60
}
function eemonth(serial_number) {
	if (!isFinite(serial_number))
		return Number.NaN;
	if (serial_number < 1)
		return 1;
	if (serial_number > 60)
		serial_number--;
	var res = jd_to_gregorian(serial_number + 2415020);
	return res[1]
}
function second(serial_number) {
	if (!isFinite(serial_number))
		return Number.NaN;
	var res = Math
			.floor((serial_number - Math.floor(serial_number)) * 86400 + .5);
	return res % 60
}
function weekday(serial_number, return_type) {
	if (!isFinite(return_type) || !isFinite(serial_number))
		return Number.NaN;
	if (return_type < 1 || return_type > 3)
		return Number.NaN;
	var res = Math.floor(serial_number + 6) % 7;
	switch (Math.floor(return_type)) {
	case 1:
		return res + 1;
	case 2:
		return (res + 6) % 7 + 1;
	case 3:
		return (res + 6) % 7
	}
	return "hej"
}
function year(serial_number) {
	if (!isFinite(serial_number))
		return Number.NaN;
	if (serial_number < 1)
		return 1900;
	if (serial_number > 60)
		serial_number--;
	var res = jd_to_gregorian(serial_number + 2415020);
	return res[0]
}